﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Infragistics.Controls.Menus;

namespace StartupSolution.Views.Menus.BuildingOutlookbar
{
    public partial class OutlookBarCodeBehind : Page
    {
        public OutlookBarCodeBehind()
        {
            InitializeComponent();

            Loaded += new RoutedEventHandler(OutlookBarCodeBehind_Loaded);
        }

        void OutlookBarCodeBehind_Loaded(object sender, RoutedEventArgs e)
        {
            // Create a XamOutlookBar control
            XamOutlookBar outlookBar = new XamOutlookBar();

            // Set the XamOutlookBar control Width, MinimizedWidth, HorizontalAlignment properties.
            outlookBar.Width = 250;
            outlookBar.Height = 400;
            outlookBar.MinimizedWidth = 40;
            outlookBar.HorizontalAlignment = HorizontalAlignment.Left;

            // Create an OutlookBarGroup with a header and images
            OutlookBarGroup mailGroup = new OutlookBarGroup();
            mailGroup.Header = "Mail";
            mailGroup.LargeIconTemplate = this.Resources["dtMailLarge"] as DataTemplate;
            mailGroup.SmallIconTemplate = this.Resources["dtMailSmall"] as DataTemplate;
            mailGroup.Content = "Mail Group Content";

            // TODO: Add more OutlookBarGroups in the XamOutlookBar control

            // OutlookBarGroup calendarGroup = new OutlookBarGroup();
            // calendarGroup.Header = "Calendar";
            // calendarGroup.LargeIconTemplate = this.Resources["dtCalendarLarge"] as DataTemplate;
            // calendarGroup.SmallIconTemplate = this.Resources["dtCalendarSmall"] as DataTemplate;
            // calendarGroup.Content = "Calendar Group Content";
            // outlookBar.Groups.Add(calendarGroup);

            // Add the created OutlookBarGroups to the XamOutlookBar Groups collection
            outlookBar.Groups.Add(mailGroup);

            // Add the XamOutlookBar control to the container grid LayoutRoot
            LayoutRoot.Children.Add(outlookBar);
            Grid.SetRow(outlookBar, 2);
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

    }
}
